package com.toss.single;

import io.vertx.core.Vertx;
import io.vertx.core.eventbus.EventBus;

public class VertxEvent {
    public static void main(String[] args) {
        Vertx vertx = Vertx.vertx();
        EventBus eventBus = vertx.eventBus();
        eventBus.consumer("mail", message -> {
            System.out.println("mail send" + message.body());
            message.reply("Ok");
        });
        eventBus.send("mail", "to wuzk@hst.com Vert.x Event",res->{
            if (res.succeeded()) {
                System.out.println("mail send succeeded");
            }
        });
    }
}
